/*
 * Filename BoardStatus.java 2021年11月01日
 * Copyright © Ehome Co.Ltd. All Rgiths Reserved.
 * @author wuyingchao
 */
package com.ehome.poct.core.api.common;

import lombok.Getter;

import java.util.Arrays;

/**
 * 板子状态
 *
 * @author wyc
 * @since 2021/11/01 14:22
 **/
@Getter
public enum CellBoardStatus {
    FACTORY(0, "出厂"),
    CHECKED(1, "已质检"),
    USED(2, "已使用"),
    ABANDON(3, "已废弃");
    private final int type;
    private final String desc;

    CellBoardStatus(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static CellBoardStatus findByType(Integer type) {
        return Arrays.stream(values()).filter(it -> it.type == type).findFirst().orElse(null);
    }
}